A [[Rank 1 Constraint System]] (R1CS) represented as a set of polynomials instead of matrices and vectors. The motivation is to be able to perform quicker equality testing.
We can represent vectors as polynomials by treating the elements in the vector as values on a polynomial, e.g. a vector would become simply assuming we have a base vector of . We can obtain this polynomial using Lagrange interpolation.
Vector addition is homomorphic to polynomial addition, i.e.
can be rewritten as
Now we can represent these vectors as polynomials.
Over a large enough field, the intersections of these polynomials is negligible as given by the Schwartz-Zippel Lemma, meaning by simply comparing the values at the same position on both polynomials, we can check for equality of the vectors. This is in time, instead of where is the size of the vector. This is of course excluding the overhead of converting into a polynomial, and calculating the polynomial value. In fact the important saving here isn’t in the time, but in the space, as this way we only need to transfer and prove one field element instead of .
Once we have in polynomial forms, we can simply multiply through by the scalars, and then sum the resulting polynomials for to get .
However, we cannot simply multiply as this would result in a polynomial of higher degree than . We must also add a compensating polynomial with roots at the values we are using for our interpolation to , which brings them to the same degree, while leaving the interpolation intact.
In order to prevent the prover from choosing a malicious which does not have the correct roots, we must limit its form. We do this by decomposing it into , where , this means that no matter what is, it will multiply out with the same roots. We can then compute